package com.zhangzhan.base.constant;

/**
 * @ClassName CommonConstant
 * @Description: CommonConstant
 * @Author gaojintao
 * @Date 2020/2/12 15:10
 * @Version V1.0
 **/
public interface CommonConstant {

    // ----------------------------1.token-----------------------------------------------
    //访问令牌token 外部使用
    String HEADER_X_ACCESS_TOKEN = "xAccessToken";

    // ----------------------------2.user-----------------------------------------------
    //请求头用户id 内部调用使用
    String HEADER_INTERNAL_USER_ID = "internalUserId";
    //请求头用户name 内部调用使用
    String HEADER_INTERNAL_USER_NAME = "internalUserName";

    //内部请求之间传输的登录用户信息
    String HEADER_INTERNAL_USER = "internalUser";

    // ---------------------------3.menu-----------------------------------------------
    //请求头菜单id
    String HEADER_MENU_ID = "menuId";
    //请求头菜单name
    String HEADER_MENU_NAME = "menuName";

    // ---------------------------4.window-----------------------------------------------

    //请求头窗体id
//    String HEADER_WINDOW_ID = "windowId";

    //数据集
    String HEADER_ASSEMBLY_NAME = "assemblyName";

    //请求头窗体name
    String HEADER_WINDOW_NAME = "windowName";

    // ----------------------------5.ip-----------------------------------------------
    //请求头remote ip
    String HEADER_CLIENT_REAL_IP = "clientRealIp";

    // ----------------------------6.db-----------------------------------------------

    //请求头dataType    1. productDateSource  2. archiveDataSource
    String HEADER_DATA_TYPE = "dataType";


    // ----------------------------7.版本-----------------------------------------------
    public static final String HEADER_VERSION = "version";


    // ----------------------------8.其他-----------------------------------------------


    // ----------------------------9.分页-----------------------------------------------

    //自由查询用到的分页单页显示数量
    public  static  final  Integer PAGE_SIZE = 20000;

    //自由查询用，默认返回分页查询的第一页
    public  static final Integer PAGE_NO = 1;
//    public  static  final Integer PAGE_QUERY_COUNT = 20000;



    //请求头内部自由查询
    String HEADER_INTERNAL_FREE_QUERY = "internalFreeQuery";

    //请求头内部自由查询
    String DATA_PERMISSION = "dataPermission";


    //日志链路追踪id信息头
    public static final String HEADER_TRACE_ID = "traceId";

    //日志链路追踪id日志标志
    public static final String HEADER_LOG_TRACE_ID = "logTraceId";

    //灰度发布版本号
    public static final String HEADER_GRAY_VERSION = "grayVersion";


    //开发测试生产环境
    String DEV = "dev";
    String TEST = "test";
    String PROD = "prod";

    /**
     * 是否boot项目
     */
    public static final String IS_BOOT = "boot";

    /**
     * {@code 500 Server Error} (HTTP/1.0 - RFC 1945)
     */
    public static final Integer SC_INTERNAL_SERVER_ERROR_500 = 500;
    /**
     * {@code 200 OK} (HTTP/1.0 - RFC 1945)
     */
    public static final Integer SC_OK_200 = 200;

    /**
     * 访问权限认证未通过 510
     */
    public static final Integer SC_JEECG_NO_AUTHZ = 510;

    /**
     * 登录用户Token令牌缓存KEY前缀
     */
    public static final String PREFIX_USER_TOKEN = "Golbal:userlogin:prefix_user_token_";

    /**
     * 登录用户缓存KEY前缀
     */
    public static final String PREFIX_USER = "Golbal:userlogin:prefix_user_";

    /**
     * 用户token登录过期时间是此时间的两倍，以token在reids缓存时间为准
     * 60分钟  60 * 60 * 1000
     * 60年 60 * 365 * 24 * 60 * 60 * 1000
     */
    public static final long JWT_EXPIRE_TIME = 60 * 365 * 24 * 60 * 60 * 1000;

    /**
     * 字典翻译文本后缀
     */
    String DICT_TEXT_SUFFIX = "Golbal:_dictText";


    /**
     * 删除枚举类
     */
    public static enum Del {
        DEL_FLAG_0(0, "未删除"),
        DEL_FLAG_1(1, "删除");

        private Del(Integer value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        private final Integer value;
        private final String desc;

        public Integer getValue() {
            return value;
        }

        public String getDesc() {
            return desc;
        }

    }

    /**
     * 增加修改需要自动填充创建人创建时间
     */
    public static enum User {

        FIELD_LRY("lry", "录入员"),
        FIELD_LRSJ("lrsj", "录入时间"),
        FIELD_INSERTSJ("insertsj", "插入时间"),
        FIELD_XGY("xgy", "修改员"),
        FIELD_XGSJ("xgsj", "修改时间"),
        FIELD_UPDATESJ("updatesj", "修改时间");

        private User(String key, String desc) {
            this.key = key;
            this.desc = desc;
        }

        private final String key;
        private final String desc;

        public String getKey() {
            return key;
        }

        public String getDesc() {
            return desc;
        }
    }



    //-------------------------------------ActiveMQ  start --------------------------------
    // quene模式可以分组group
    public static final String ActiveMQ_$BROKER_URL = "${spring.activemq.broker-url}";
    public static final String ActiveMQ_$USER = "${spring.activemq.user}";
    public static final String ActiveMQ_$PASSWORD = "${spring.activemq.password}";
    /**
     *     queue-inbound-navis: NavisIB
     *     queue-inbound-edi: EDIIB
     *     queue-outbound-navis: NavisOB
     *     queue-outbound-error-navis: Error_NavisIB
     *     queue-outbound-error-edi: Error_EDIIB
     */

    public static final String ActiveMQ_QUENE_LISTENER_BEAN = "queueJmsListener";


    //单条消息确认
    public static final int INDIVIDUAL_ACKNOWLEDGE  = 4;



    //-------------------------------------ActiveMQ  end --------------------------------


    //-------------------------------------N4 webservice  start --------------------------------
    public static final String WEBSERVICE_$IP = "${spring.n4webservice.ip}";
    public static final String WEBSERVICE_$PORT = "${spring.n4webservice.port}";
    //-------------------------------------N4 webservice  end --------------------------------


    //elasticsearch时间格式化
    public static final String yyyy_MM_dd_HH_mm_ss = "yyyy-MM-dd HH:mm:ss";

    public static final String ELASTICSEARCH_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
    //时区
    public static final String ELASTICSEARCH_TIME_ZONE = "GMT+8";
    //索引
    public static final String ELASTICSEARCH_INDEX = "aduit_log";
    //索引type
    public static final String ELASTICSEARCH_INDEX_TYPE = "aduit_log";
    //分片10
    public static final int    ELASTICSEARCH_INDEX_SHARDS = 5;//shards



    //smartlog  transStatus交易状态1 成功 2失败
    public static final String TRANS_STATUS_SUCCESS="1";
    public static final String TRANS_STATUS_FAILED="2";


    //logback  mdc 变量
    public static final String MDC_IP = "ip";//logback 通过%X{ip}获取对应请求header中的clientRealIp


    /**
     * bill 公共使用
     */
    public static  final String MTDT ="QQCT";
    public static final String N4_IP = "10.34.20.64";
    public static final String N4_PORT = "80";
    public static final String N4_USERNAME = "chenjp";
    public static final String N4_PASSWORD = "123456";
    public static final String N4_SCOPE_COORDINATE_IDS = "QQCT/CNQIN/QQCT/QQCT";

}
